home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Entertainment / luff stuff / luff⁄utboard.c < prev   
Encoding:
Text File  |  1985-11-08  |  549 b   |  42 lines  |  [TEXT/MACA]

  1. # include "MacLuff.h"
  2.  
  3. /* Prints out an image of th board */
  4. utboard(){
  5.     int x, y;
  6.  
  7.     HideCursor();
  8.  
  9.     EraseRect(&the_w->portRect);
  10.  
  11.     draw_holes();
  12.  
  13.     for(y = 0; y < YZIZE; y++){
  14.         for(x = 0; x < XZIZE; x++){
  15.             switch(board[x][y]){
  16.                 case ' ':
  17.                     draw_empty(x, y);
  18.                     break;
  19.                 case 'o':
  20.                     draw_o(x, y);
  21.                     break;
  22.                 case 'x':
  23.                     draw_x(x, y);
  24.                     break;
  25.             }
  26.  
  27.         }
  28.     }
  29.     ShowCursor();
  30. }
  31.  
  32. draw_holes(){
  33.     int x, y;
  34.  
  35.     for(x = 0; x < 4; x++){
  36.         PenPat(&QD->gray);
  37.         PaintOval(&hole_r[x]);
  38.         PenPat(&QD->black);
  39.         FrameOval(&hole_r[x]);
  40.     }
  41. }
  42.